package com.study.jvm;

public class StackOverflow {
    static int count = 0;

    static void m1() {
        count = count + 1;
        for (int i = 0; i < 5; i++) {
            m1();
        }
    }

    public static void main(String[] args) {
        //可以通过 -Xss 参数指定虚拟机栈内存大小
        //2487
        try {
            m1();
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
        System.out.println("count = " + count);
    }
}
